package com.atlinmengze.java.ai.langchain4j.config;

import dev.langchain4j.memory.chat.MessageWindowChatMemory;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class MemoryChatAssistantConfig {
    //创建一个对象，注入到Spring容器中
    @Bean
    public MessageWindowChatMemory chatMemory()
    {
        return MessageWindowChatMemory.withMaxMessages(10);
    }
}
